<%inherit file="/en/base.html"/>
<%namespace file="/gmap.html" import="*"/>
<%namespace file="/en/wpedit.html" import="*"/>

Way points for <a href="/myjourney/edit?journey=${ctx.j.key()}">${ctx.j.name}</a>

<script type="text/javascript">

function showa( diva )
{
   if (document.layers) document.layers[diva].visibility="show";
   else document.getElementById(diva).style.visibility="visible";
    return false;
}

function hideDiv(divid) {
   if (document.layers) document.layers[divid].visibility="hide";
   else document.getElementById(divid).style.visibility="hidden";
}
</script>


${journeypoly_gmapjs()|n}
${journeypoly_view()|n}

<%def name="bodyspec()">
 onload="journeypoly_initialize()" onunload="GUnload()"
</%def>


    <ol>
    % for wp in ctx.j.waypoints:
    
        <li> 
            <div id=wp>
                <div id=head style="border:1px solid #000000;background-color:#EEEEEE">
                    ${wp.pos}&nbsp;
                    <% flag = False %>
                    % if wp.arrived:
                        Arrived: ${wp.arrived}&nbsp;
                        <% flag = True %>
                    %endif
                    %if wp.leaved:
                        Leaved:${wp.leaved}&nbsp;
                        <% flag = True %>
                    %endif
                    % if flag:
                        <br>
                    % endif
                    % if wp.coords:
                        Coordinates: ${wp.coords}
                    %endif
                    <% icons = { 1:"Default icon" } %>
                    % if wp.icon != None and wp.icon != 0:
                        <br>Icon: ${icons[wp.icon]}
                    %endif
                    <span style="position:absolute;right:3px">
                        <a href="#" onclick="journeypoly_center(${wp.lat()},${wp.lng()});return false;">Center on map</a>
                        <a href="/waypoints/movup?journey=${ctx.j.key()}&wp=${wp.key()}">Up</a>
                        <a href="/waypoints/movdown?journey=${ctx.j.key()}&wp=${wp.key()}">Down</a>
                        <a href="/waypoints/edit?journey=${ctx.j.key()}&wp=${wp.key()}">Edit</a>
                    </span>
                </div>
                
                <p id=wpdesc style="margin:10px 5px;width:600px">${ctx.h.textcut( wp.desc, 100, "/waypoints/view?wp=%s&journey=%s" % ( wp.key(), ctx.j.key()) ) }</p>
             </div>   
        </li>
    
    % endfor
    </ol>
    
    
</table>

<!--a href="" onclick="try {return showa('forma');}catch(e){return true;};">Add new waypoint</a-->
<%def name="context_menu()">
<a href="/waypoints/new?journey=${ctx.j.key()}">Add New waypoint</a>
</%def>
